"""
快照测试工具模块
"""
from datetime import datetime

class SnapshotValidator:
    """快照数据验证工具类"""
    
    @staticmethod
    def convert_voltage(raw_bytes):
        """电压值转换 (D004规范)"""
        return (raw_bytes[0] << 8 | raw_bytes[1]) * 0.05625
    
    @classmethod
    def validate_timing(cls, raw_bytes):
        """时间戳验证 (D001规范)"""
        try:
            datetime(
                year=2000 + raw_bytes[0],
                month=raw_bytes[1],
                day=raw_bytes[2],
                hour=raw_bytes[3],
                minute=raw_bytes[4],
                second=raw_bytes[5]
            )
            return True
        except ValueError:
            return False
